<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>axios基本使用</title>
  <script src="js/axios.js" type="text/javascript"></script>
</head>
<body>
  <button onclick="getAllUser()">获取所有人（get请求，不传参数）</button>

  <script>
    // get请求不传参数
    // function getAllUser() {
    //   let result = axios.get('http://localhost:8001/user/getList')
    //   console.log('result', result);
    //   result.then(res => {
    //     console.log('data', res.data);
    //   })
    // }
    async function getAllUser() {
      let result = await axios.get('http://localhost:8001/user/getList')
      console.log('data', result.data)
    }
  </script>
</body>
</html>